// subpkg/aearch/aearch.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    courses: [],
  },
  async onSearch(e) {
    // console.log(e)
    if (e.detail.trim().length === 0) return
    const res = await wx.$request({
      url: 'course/search',
      data: {
        name: e.detail
      }
    })
    console.log(res)
    if (res.status === 0) {
      this.setData({
        courses: res.message
      })

    }
  }

})